[LG-5863] fix(NumberInput): align styles with design#3453
Conversation
🦋 Changeset detectedLatest commit: 095dcbc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Drive-by fix to improve prop selection
| ref={inputRef} | ||
| value={value} | ||
| unit={unitOptions.length ? unit : unitProp} | ||
| unit={unitOptions.length ? unit : ((unitProp ?? 'one') as string)} |
There was a problem hiding this comment.
Drive-by to fix type error
|
Note to reviewer: By removing uppercase enforcement this PR can create a scenario where a consumer had a value "month" that was being rendered "MONTH" and will now just be rendered "month." I considered enforcing capitalization, but I thought this wasn't a horrible misalignment and was easy enough to fix (hopefully) on upgrade. Would appreciate a second opinion on this! |
There was a problem hiding this comment.
Pull request overview
This PR aligns the NumberInput component's styling with design specifications by removing forced uppercase text transformation and standardizing font weights.
Changes:
- Removed uppercase text transformation from unit select buttons
- Updated font weight to semiBold across unit display elements
- Changed unit-only display from
OverlinetoBodytypography component
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/number-input/src/UnitSelectButton/UnitSelectButton.styles.ts | Removes uppercase text transformation from menu button |
| packages/number-input/src/UnitSelect/UnitSelect.styles.ts | Adds semiBold font weight and removes text transformation |
| packages/number-input/src/NumberInput/NumberInput.tsx | Replaces Overline with Body component for unit display |
| packages/number-input/src/NumberInput/NumberInput.styles.ts | Adds semiBold font weight to unit styles |
| packages/number-input/src/NumberInput.stories.tsx | Updates story display names and fixes type handling |
| packages/select/src/Select.stories.tsx | Adds state, size, and message controls to story |
| .changeset/fruity-candles-march.md | Documents the style changes |
|
Size Change: +22 B (0%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
.changeset/fruity-candles-march.md
Outdated
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@leafygreen-ui/number-input': patch | |||
There was a problem hiding this comment.
It's a fairly small visual change, but this seems like at least a minor change. It will break visual testing and likely requires some migration effort in case the displayName is incorrectly formatted. Curious on reasoning for making it a patch change?
There was a problem hiding this comment.
I think you're right! More because of the nature of the change though, as opposed to its inherent impact.
Ideally, this is not breaking. If it is I think it actually should be major. But for a visual change like this, I just don't think it will actually break anything.
Where I think I'm incorrect is that I was seeing this a bug fix (patch) as opposed to a "feature" add (minor). In reality, this isn't really a bug as much as its a change of design approach, which is technically a "feature" from a design system's perspective.
TL;DR - will bump this to a minor change 🙂
|
Coverage after merging LG-5863/num-input-no-caps into main will be
Coverage Report for Changed Files
|
|||||||||||||||||||
✍️ Proposed changes
Drive-by's:
NumberInputstory type issueSelectstory🎟 Jira ticket: LG-5863
✅ Checklist
pnpm changesetand documented my changes🧪 How to test changes
Verify in Storybook
📷 Screenshots
Before
After